﻿<!--
        SharePoint 2010 ListManager
        (c) 2010 by Daniel Bedarf

        This Program is licensed under the GNU GLP V2
        It is free to use. Please inform the Author about modification to make the tool better.

        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.

        You should have received a copy of the GNU General Public License
        along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -->

<ad:DocumentContent x:Class="CodePlex.DBedarf.Sharepoint.ListManager.ListEventReceiverPage"
	  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	  xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	  xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock"
	  mc:Ignorable="d" 
	  d:DesignHeight="300" d:DesignWidth="300"
	 Title="ListEventhandler" Background="White" Loaded="DocumentContent_Loaded">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="40" />
            <RowDefinition Height="205*" />
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" Orientation="Horizontal">
            <Label>Selected List(s):</Label>
            <Label Name="lblSelectedLists"></Label>
        </StackPanel>
        <StackPanel Grid.Row="1" >
            <Expander Header="Attached Receiver" x:Name="expCurrentHandler" IsExpanded="True" Margin="10">
                <StackPanel Orientation="Vertical">
                    <ListView x:Name="lvwCurrentEventHandler" SelectionMode="Extended" Foreground="Black" >
                        <ListView.View>
                            <GridView>
                                <GridViewColumn Header="Type"  Width="100" DisplayMemberBinding="{Binding Type}" />
                                <GridViewColumn Header="Assembly" Width="150" DisplayMemberBinding="{Binding Assembly}" />
                                <GridViewColumn Header="Class" Width="150" DisplayMemberBinding="{Binding Class}" />
                            </GridView>
                        </ListView.View>
                    </ListView>
                    <Button Content="Remove Selected" Width="120" HorizontalAlignment="Right"  Margin="0,25,0,0" Click="Useraction_RemoveSelectedHandler" IsEnabled="True" />
                </StackPanel>
            </Expander>
            <Expander Header="New Receiver" x:Name="expNewHandler" Margin="10">
                <ScrollViewer VerticalScrollBarVisibility="Auto">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="63" />
                            <ColumnDefinition Width="190*" />
                            <ColumnDefinition Width="35" />
                        </Grid.ColumnDefinitions>

                        <Label Content="Assembly:" Grid.ColumnSpan="2"  />
                        <TextBox Grid.Column="1" IsReadOnly="True" IsUndoEnabled="False" TextWrapping="Wrap" Style="{StaticResource SimpleTextBox}" Name="txtAssembly" />
                        <Button Grid.Column="2" Content="..." Width="30" HorizontalAlignment="Right" Click="Useraction_BrowseForAssembly" />

                        <CheckBox Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Content="Show only Classes which implements SPItemEventReceiver" Margin="0,5,0,5" Name="chkShowOnlySPItemEventReceiver" IsChecked="True" Checked="Useraction_chkOnlySPListItemChanged" Unchecked="Useraction_chkOnlySPListItemChanged" />

                        <Label Grid.Row="2" Content="Class:" />
                        <ComboBox Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2"  Margin="0,5,0,5" Name="cboClasses" />

                        <Label Grid.Row="3" Content="Event:"  />
                        <ComboBox Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2"  Margin="0,5,0,5" Name="cboListEventType" />

                        <Button Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="2" Content="Add" Width="90" HorizontalAlignment="Right" Click="Useraction_AddNewHandler" Name="cmdAdd" IsEnabled="False" />
                    </Grid>
                </ScrollViewer>
            </Expander>
        </StackPanel>
    </Grid>
</ad:DocumentContent>
